home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / gnustuff / tos / updates / update25.zoo / lib / Makefile < prev    next >
Encoding:
Makefile  |  1992-10-09  |  2.7 KB  |  168 lines

  1. #
  2. # Top level Makefile for TOS-Gcc library
  3. #
  4.  
  5. # GCC configuration info...
  6.  
  7. # Leave the next line undefined for native compilation setup.
  8. CROSSDIR := /net/acae127/home/bammi/atari/cross-gcc
  9.  
  10. # Define MINTFLAG when compiling mntlib
  11. # MINTFLAG := -mint
  12.  
  13. ifdef MINTFLAG
  14. MINTOPT := -mint
  15. else
  16. MINTOPT :=
  17. endif
  18.  
  19. ifdef CROSSDIR
  20.  
  21. # Set up to do cross-compiling...
  22.  
  23. CROSSLIB := $(CROSSDIR)/lib
  24. CROSSBIN := $(CROSSDIR)/bin
  25.  
  26. AR    := $(CROSSBIN)/car
  27. AS     := cgcc $(MINTOPT)
  28. CC    := cgcc $(MINTOPT)
  29. LIB     := $(CROSSLIB)
  30. VPATH   := ../co
  31.  
  32. else
  33.  
  34. # Set up to run native...
  35.  
  36. AR    := gcc-ar
  37. AS    := gcc $(MINTOPT)
  38. CC    := gcc $(MINTOPT)
  39. LIB    := d:\gnu\lib
  40.  
  41. endif
  42.  
  43. # Additional options for compiling C code
  44.  
  45. XFLAGS := -I../co
  46.  
  47. # Dynamic selection of options for each target library...
  48.  
  49. ifneq (,$(findstring debug,$(TARGET)))
  50. OPTIM= -O -g -Wstrict-prototypes
  51. FRAME=
  52. DEBUG=
  53. g=g
  54. else
  55. OPTIM= -O2 -fstrength-reduce
  56. FRAME= -fomit-frame-pointer
  57. DEBUG= -DNDEBUG
  58. g=
  59. endif
  60.  
  61. ifneq (,$(findstring long-int,$(TARGET)))
  62. SHORT=
  63. DSHORT=
  64. ST=
  65. else
  66. SHORT= -mshort
  67. DSHORT= -DSHORTLIB
  68. ST=16
  69. endif
  70.  
  71. ifneq (,$(findstring 68020,$(TARGET)))
  72. CC := $(CC) -m68020
  73. endif
  74.  
  75. ifneq (,$(findstring baserel,$(TARGET)))
  76. CC := $(CC) -mbaserel
  77. b=b
  78. else
  79. b=
  80. endif
  81.  
  82. # common subset of options; no int size or omit-frame-pointer:
  83. COPTS= $(DEBUG) $(OPTIM) $(XFLAGS)
  84.  
  85. # Base options CC; includes int size but not omit-frame-pointer
  86. CFFLAGS = $(SHORT) $(COPTS)
  87.  
  88. # normal CFLAGS including int size and omit-frame-pointer
  89. CFLAGS= $(CFFLAGS) $(FRAME)
  90.  
  91. # cflags for stuff that needs to be compiled with 32 bit ints
  92. CLFLAGS= $(COPTS) $(FRAME) $(DSHORT)
  93.  
  94. # flags to $(CC) when it runs the assembler only
  95. ASFLAGS= -c
  96.  
  97. # flags to $(CC) when running preprocessor and assembler
  98. PPFLAGS= $(SHORT) -P -c
  99.  
  100. # library targets
  101. ifdef MINTFLAG
  102.  
  103. CLIB= $bmint$g$(ST).olb
  104. CLIB020=$bmint$g$(ST)020.olb
  105. IIOLIB= $bmiio$g$(ST).olb
  106. CRT0=$bmcrt0.o
  107. GCRT0=$bmgcrt0.o
  108.  
  109. else
  110.  
  111. CLIB= $bgnu$g$(ST).olb
  112. CLIB020=$bgnu$g$(ST)020.olb
  113. IIOLIB= $biio$g$(ST).olb
  114. CRT0=$bcrt0.o
  115. GCRT0=$bgcrt0.o
  116.  
  117. endif
  118.  
  119. STARTO= $(CRT0) $(GCRT0)
  120.  
  121. # the stuff to make
  122. ALL= $(CLIB) $(IIOLIB) $(STARTO)
  123. ALL020 = $(CLIB020) $(STARTO)
  124.  
  125. #all: lshort llong lgshort lglong
  126. top: lshort llong
  127.  
  128. lshort:
  129.     $(MAKE) clean
  130.     $(MAKE) install
  131.  
  132. llong:
  133.     $(MAKE) clean
  134.     $(MAKE) install TARGET=long-int
  135.  
  136. lgshort:
  137.     $(MAKE) clean
  138.     $(MAKE) install TARGET=debug
  139.  
  140. lglong:
  141.     $(MAKE) clean
  142.     $(MAKE) install TARGET="long-int debug"
  143.  
  144. l020short:
  145.     $(MAKE) clean
  146.     $(MAKE) install020 TARGET=68020
  147.  
  148. l020long:
  149.     $(MAKE) clean
  150.     $(MAKE) install020 TARGET="68020 long-int"
  151.  
  152. lbshort:
  153.     $(MAKE) clean
  154.     $(MAKE) install TARGET="baserel"
  155.  
  156. lblong:
  157.     $(MAKE) clean
  158.     $(MAKE) install TARGET="long-int baserel"
  159.  
  160. realclean:
  161.     rm -f *.o *.olb
  162.     rm -f core report
  163.  
  164. # Get the rules to build everything...
  165.  
  166. include mincl
  167.